﻿//===================================================================================
// Copyright (c) Ryan Garrett.  All rights reserved.
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY
// OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT
// LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
// FITNESS FOR A PARTICULAR PURPOSE.
//===================================================================================

using Caffeine.Core.Test.TestModel;
using Caffeine.Core.Test.TestModel;

namespace Caffeine.Core.Test
{
    public class ModelGraphContainer
    {
        public ModelForGraphTests Root = Creator.Create<ModelForGraphTests>();
        public ModelForGraphTests ModelA = Creator.Create<ModelForGraphTests>();
        public ModelForGraphTests ModelAA = Creator.Create<ModelForGraphTests>();
        public ModelForGraphTests ModelAB = Creator.Create<ModelForGraphTests>();
        public ModelForGraphTests ModelABA = Creator.Create<ModelForGraphTests>();
        public ModelForGraphTests ModelABAA = Creator.Create<ModelForGraphTests>();
        public ModelForGraphTests ModelABAB = Creator.Create<ModelForGraphTests>();
        public ModelForGraphTests ModelABAC = Creator.Create<ModelForGraphTests>();
        public ModelForGraphTests ModelABAD = Creator.Create<ModelForGraphTests>();
        public ModelForGraphTests ModelABB = Creator.Create<ModelForGraphTests>();
        public ModelForGraphTests ModelAC = Creator.Create<ModelForGraphTests>();
        public ModelForGraphTests ModelB = Creator.Create<ModelForGraphTests>();
        public ModelForGraphTests ModelC = Creator.Create<ModelForGraphTests>();
        public ModelForGraphTests ModelCA = Creator.Create<ModelForGraphTests>();
        public ModelForGraphTests ModelCB = Creator.Create<ModelForGraphTests>();
        public ModelForGraphTests ModelCBA = Creator.Create<ModelForGraphTests>();
        public ModelForGraphTests ModelCC = Creator.Create<ModelForGraphTests>();
        public ModelForGraphTests ModelCCA = Creator.Create<ModelForGraphTests>();
        public ModelForGraphTests ModelCCB = Creator.Create<ModelForGraphTests>();

        public ModelGraphContainer()
        {
            Root.TagName = "Root";
            ModelA.TagName = "ModelA";
            ModelAA.TagName = "ModelAA";
            ModelAB.TagName = "ModelAB";
            ModelABA.TagName = "ModelABA";
            ModelABA.TagName = "ModelABAA";
            ModelABA.TagName = "ModelABAB";
            ModelABA.TagName = "ModelABAC";
            ModelABA.TagName = "ModelABAD";
            ModelABB.TagName = "ModelABB";
            ModelAC.TagName = "ModelAC";
            ModelB.TagName = "ModelB";
            ModelC.TagName = "ModelC";
            ModelCA.TagName = "ModelCA";
            ModelCB.TagName = "ModelCB";
            ModelCBA.TagName = "ModelCBA";
            ModelCC.TagName = "ModelCC";
            ModelCCA.TagName = "ModelCCA";
            ModelCCB.TagName = "ModelCCB";

            Root.ChildrenCollection1.Add(ModelA);
            ModelA.ChildrenCollection1.Add(ModelAA);
            ModelA.ChildrenCollection1.Add(ModelAB);
            ModelAB.ChildrenCollection1.Add(ModelABA);
            ModelABA.ChildrenCollection1.Add(ModelABAA);
            ModelABA.ChildrenCollection1.Add(ModelABAB);
            ModelABA.ChildrenCollection1.Add(ModelABAC);
            ModelABA.ChildrenCollection1.Add(ModelABAD);
            ModelAB.ChildrenCollection1.Add(ModelABB);
            ModelA.ChildrenCollection1.Add(ModelAC);
            Root.ChildrenCollection1.Add(ModelB);
            Root.ChildrenCollection1.Add(ModelC);
            ModelC.ChildrenCollection1.Add(ModelCA);
            ModelC.ChildrenCollection1.Add(ModelCB);
            ModelCB.ChildrenCollection1.Add(ModelCBA);
            ModelC.ChildrenCollection1.Add(ModelCC);
            ModelCC.ChildrenCollection1.Add(ModelCCA);
            ModelCC.ChildrenCollection1.Add(ModelCCB);
        }

        public void CommitAll()
        {
            Root.ChildrenCollection1.Commit();
            ModelA.ChildrenCollection1.Commit();
            ModelAB.ChildrenCollection1.Commit();
            ModelABA.ChildrenCollection1.Commit();
            ModelC.ChildrenCollection1.Commit();
            ModelCB.ChildrenCollection1.Commit();
            ModelCC.ChildrenCollection1.Commit();
        }
    }
}
